package com.maomao.node;

import java.util.ArrayList;
import java.util.List;

public class Folder extends Node {

    private List<Node> childrenNodes = new ArrayList<>();
    public Folder(String name) {
        super(name);
    }

    @Override
    protected void add(Node child) {
        childrenNodes.add(child);
    }

    @Override
    public void ls(int space) {
        super.ls(space);
        space ++;
        for (Node node:childrenNodes) {
            node.ls(space);
        }
    }
}
